package com.systemsjr.jrappointment.appointment;

import com.systemsjr.jrappointment.appointment.vo.AppointmentVO;
import com.systemsjr.jrappointment.utils.ServiceUtils;
import com.systemsjr.jrappointment.utils.UIUtils;
import com.systemsjr.jrlib.richclient.BaseItemControl;

public class AppointmentControl extends BaseItemControl<AppointmentVO> {
	
	public AppointmentControl(){
		super();
		valueHolder = UIUtils.getAppointmentValueHolder();
	}

	@Override
	public void handleDeleteItem(AppointmentVO arg0) {
		
		ServiceUtils.getAppointmentService().delete(arg0);
		
	}

	@Override
	public AppointmentVO handleNewItem() {
		return ServiceUtils.createDefaultAppointment();
	}

	@Override
	public AppointmentVO handleSaveItem(AppointmentVO arg0) {
		setAction(arg0.getId());
		return ServiceUtils.getAppointmentService().save(arg0);
	}

}
